<div class="menu-container">
  <ul class="menu">
    <li><a href="<%= users_list_path %>">用户列表</a></li>
    <li><a href="<%= users_me_path %>">常规信息</a></li>
    <li><a class="selected">验证信息</a></li>
  </ul>
</div>

<div class="right" style="width:530px;">
  <%= '密码修改成功' if defined? success %>
  <h2 class="title-text">验证信息</h2>
  <%= form_for(@user, :url => users_update_setting_path(@user, 'auth') ) do |f| %>
    <%# devise_error_messages! %>

    <dl>
      <dt><%= f.label :current_password, "当前密码" %></dt>
      <dt><%= f.password_field :current_password, :autofocus => true %></dt>
      <% if !@user.errors[:current_password].empty? %>
        <dt class="error">当前密码不正确</dt>
      <% end %>
    </dl>
    <dl>
      <dt><%= f.label :password, "新密码" %></dt>
      <dt><%= f.password_field :password %></dt>
      <% if @user.errors[:password].include? I18n.t 'mongoid.errors.messages.too_short' %>
        <dt class="error">密码太短（最短4位）</dt>
      <% end %>
    </dl>
    <dl>
      <dt><%= f.label :password_confirmation, "密码确认" %></dt>
      <dt><%= f.password_field :password_confirmation %></dt>
      <% if @user.errors[:password].include? "doesn't match confirmation" %>
        <dt class="error">密码和密码确认不匹配</dt>
      <% end %>
    </dl>

    <%= f.submit "提交", 'class' => 'button primary form' %>
  <% end %>

</div>